<style>
    .word{
        width: 100px;
        line-height: 25px;
        white-space: nowrap;
        display: inline-block;
        height: 25px;
        overflow: hidden;
        cursor: text;
        text-align: center;
        padding: 2px 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        resize: none;
        color: #333333;
        background-color: #FFF;
        border: solid 1px #D7D7D7;
        outline: none;
    }
    .msg-set{
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
    }
</style>
<include file="common:__head__"/>
<div class="permissions-tabs">
    <a class="role tabs-bg" href="{:U('Express/index')}">运费模板</a>
</div>
<div class="permissions-content">
    <div class="permissions-le">
        <span class="add-admin"><a href="javascript:history.go(-1)"></a>快递设置</span>
        <div class="add-msg">
            <a class="add-role" href="{:U('Express/addArea', array('id'=>$id))}">添加地域+</a>
        </div>
        <div class="permissions-table">
            <table border="0" width="100%" class="msg-table">
                <thead>
                <tr>
                    <td>ID</td>
                    <td>配送区域名称</td>
                    <td>衡量标准重量</td>
                    <td>标准以上运费</td>
                    <td>标准以下运费</td>
                    <td>所辖地区</td>
                    <td>操作</td>
                </tr>
                </thead>
                <tbody class="msg-set">
                <foreach name="expressArea" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>
                            <input class="word" type="text" value="{$vo.ea_name}" onchange="changeTableVal2('express_area','id','{$vo.id}','ea_name',this)" />
                        </td>
                        <td>
                            <input class="word" type="text" value="{$vo.standard}" onchange="changeTableVal2('express_area','id','{$vo.id}','standard',this)" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" /> KG
                        </td>
                        <td>
                            <input class="word" type="text" value="{$vo.up_num}" onchange="changeTableVal2('express_area','id','{$vo.id}','up_num',this)" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" /> KG
                        </td>
                        <td>
                            <input class="word" type="text" value="{$vo.down_num}" onchange="changeTableVal2('express_area','id','{$vo.id}','down_num',this)" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" /> KG
                        </td>
                        <td style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">
                            <volist name="vo['area']" id="area" key="area" >
                                {$area['area_name']} &nbsp;
                            </volist>
                        </td>
                        <td>
                            <a href="{:U('Express/editArea', array('id'=>$vo['id']))}" class="btn btn-blue">编辑</a>
                            <a class="btn btn-red del_express" data-id="{$vo['id']}">删除</a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>
        </div>
    </div>
    <div class="permissions-ri">
        <a href="" class="permissions-help">帮助和服务</a>
    </div>

</div>
<include file="common:__foot__"/>
<script type="text/javascript">
    $(function () {
        $('.del_express').click(function () {
            var _this = $(this);
            layer.confirm('您确认卸载此配送区域吗？', {
                btn: ['确认','取消']
            }, function(){
                $.ajax({
                    url: "{:U('Express/delArea')}",
                    type: "post",
                    data: {
                        id: _this.data('id')
                    },
                    beforeSend: function () {
                        layer.msg('删除中..', {icon: 16,time:500});
                    },
                    success: function (msg) {
                        msg==1 ? window.location.reload() : layer.msg('删除失败!', {icon: 2,time:1000});
                    }
                });
            });
        });
    });
</script>
</body>
</html>